package com.itjin.health.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 可用时间段实体类
 */
@Data
@TableName("availableslots")
public class AvailableSlot implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * 可用时间段ID
   */
  @TableId(value = "asid", type = IdType.AUTO)
  private Integer asId;

  /**
   * 管理员ID
   */
  @TableField("AdminID")
  private Integer adminId;

  /**
   * 时间段ID
   */
  @TableField("SlotID")
  private Integer slotId;

  /**
   * 地点ID (线下评估时必填)
   */
  @TableField("LocationID")
  private Integer locationId;

  /**
   * 评估类型：线上/线下
   */
  @TableField("AssessmentType")
  private String assessmentType;

  /**
   * 是否可用
   */
  @TableField("Available")
  private Boolean available;

  /**
   * 发布日期
   */
  @TableField("PublishDate")
  private LocalDate publishDate;

  /**
   * 发布年份
   */
  @TableField("PublishYear")
  private Integer publishYear;

  /**
   * 发布周数
   */
  @TableField("PublishWeek")
  private Integer publishWeek;

  /**
   * 创建时间
   */
  @TableField(value = "CreatedAt", fill = FieldFill.INSERT)
  private LocalDateTime createdAt;

  /**
   * 更新时间
   */
  @TableField(value = "UpdatedAt", fill = FieldFill.INSERT_UPDATE)
  private LocalDateTime updatedAt;

  // 关联属性，便于前端展示
  @TableField(exist = false)
  private TimeSlot timeSlot;

  @TableField(exist = false)
  private Location location;
}